package com.autumn.mybatis.provider;

import com.autumn.mybatis.provider.annotation.ProviderDrive;

/**
 * 数据提供者抽象
 * 
 * @author 杨昌国
 *
 *         2017-10-19 08:24:10
 */
public abstract class AbstractProvider implements IDbProvider {

	private final String driveName;	

	/**
	 * 
	 */
	public AbstractProvider() {
		ProviderDrive drive = this.getClass().getAnnotation(ProviderDrive.class);
		if (drive != null) {
			this.driveName = drive.name();
		} else {
			this.driveName = "";
		}	
	}

	/**
	 * 获取驱动名称
	 * 
	 * @return
	 */
	@Override
	public String getDriveName() {
		return this.driveName;
	}	
}
